Optimal. Leaf size=83 \[ -i \text {Li}_2\left (e^{2 i x}\right )-\frac {x^3}{2}-i x^2-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)+\frac {x}{4}+2 x \log \left (1-e^{2 i x}\right )-\frac {1}{2} x \cos ^2(x)+\frac {1}{4} \sin (x) \cos (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 10, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {4408, 3311, 30, 2635, 8, 3720, 3717, 2190, 2279, 2391} \[ -i \text {PolyLog}\left (2,e^{2 i x}\right )-\frac {x^3}{2}-i x^2-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)+\frac {x}{4}+2 x \log \left (1-e^{2 i x}\right )-\frac {1}{2} x \cos ^2(x)+\frac {1}{4} \sin (x) \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2190
Rule 2279
Rule 2391
Rule 2635
Rule 3311
Rule 3717
Rule 3720
Rule 4408
Rubi steps
\begin {align*} \int x^2 \cos ^2(x) \cot ^2(x) \, dx &=-\int x^2 \cos ^2(x) \, dx+\int x^2 \cot ^2(x) \, dx\\ &=-\frac {1}{2} x \cos ^2(x)-x^2 \cot (x)-\frac {1}{2} x^2 \cos (x) \sin (x)-\frac {\int x^2 \, dx}{2}+\frac {1}{2} \int \cos ^2(x) \, dx+2 \int x \cot (x) \, dx-\int x^2 \, dx\\ &=-i x^2-\frac {x^3}{2}-\frac {1}{2} x \cos ^2(x)-x^2 \cot (x)+\frac {1}{4} \cos (x) \sin (x)-\frac {1}{2} x^2 \cos (x) \sin (x)-4 i \int \frac {e^{2 i x} x}{1-e^{2 i x}} \, dx+\frac {\int 1 \, dx}{4}\\ &=\frac {x}{4}-i x^2-\frac {x^3}{2}-\frac {1}{2} x \cos ^2(x)-x^2 \cot (x)+2 x \log \left (1-e^{2 i x}\right )+\frac {1}{4} \cos (x) \sin (x)-\frac {1}{2} x^2 \cos (x) \sin (x)-2 \int \log \left (1-e^{2 i x}\right ) \, dx\\ &=\frac {x}{4}-i x^2-\frac {x^3}{2}-\frac {1}{2} x \cos ^2(x)-x^2 \cot (x)+2 x \log \left (1-e^{2 i x}\right )+\frac {1}{4} \cos (x) \sin (x)-\frac {1}{2} x^2 \cos (x) \sin (x)+i \operatorname {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{2 i x}\right )\\ &=\frac {x}{4}-i x^2-\frac {x^3}{2}-\frac {1}{2} x \cos ^2(x)-x^2 \cot (x)+2 x \log \left (1-e^{2 i x}\right )-i \text {Li}_2\left (e^{2 i x}\right )+\frac {1}{4} \cos (x) \sin (x)-\frac {1}{2} x^2 \cos (x) \sin (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.10, size = 72, normalized size = 0.87 \[ \frac {1}{8} \left (-8 i \text {Li}_2\left (e^{2 i x}\right )-4 x^3-8 i x^2-2 x^2 \sin (2 x)-8 x^2 \cot (x)+16 x \log \left (1-e^{2 i x}\right )+\sin (2 x)-2 x \cos (2 x)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.48, size = 162, normalized size = 1.95 \[ \frac {{\left (2 \, x^{2} - 1\right )} \cos \relax (x)^{3} + 4 \, x \log \left (\cos \relax (x) + i \, \sin \relax (x) + 1\right ) \sin \relax (x) + 4 \, x \log \left (\cos \relax (x) - i \, \sin \relax (x) + 1\right ) \sin \relax (x) + 4 \, x \log \left (-\cos \relax (x) + i \, \sin \relax (x) + 1\right ) \sin \relax (x) + 4 \, x \log \left (-\cos \relax (x) - i \, \sin \relax (x) + 1\right ) \sin \relax (x) - {\left (6 \, x^{2} - 1\right )} \cos \relax (x) - {\left (2 \, x^{3} + 2 \, x \cos \relax (x)^{2} - x\right )} \sin \relax (x) - 4 i \, {\rm Li}_2\left (\cos \relax (x) + i \, \sin \relax (x)\right ) \sin \relax (x) + 4 i \, {\rm Li}_2\left (\cos \relax (x) - i \, \sin \relax (x)\right ) \sin \relax (x) + 4 i \, {\rm Li}_2\left (-\cos \relax (x) + i \, \sin \relax (x)\right ) \sin \relax (x) - 4 i \, {\rm Li}_2\left (-\cos \relax (x) - i \, \sin \relax (x)\right ) \sin \relax (x)}{4 \, \sin \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x^{2} \cos \relax (x)^{2} \cot \relax (x)^{2}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.11, size = 112, normalized size = 1.35 \[ -\frac {x^{3}}{2}+\frac {i \left (2 x^{2}+2 i x -1\right ) {\mathrm e}^{2 i x}}{16}-\frac {i \left (2 x^{2}-2 i x -1\right ) {\mathrm e}^{-2 i x}}{16}-\frac {2 i x^{2}}{{\mathrm e}^{2 i x}-1}+2 x \ln \left (1+{\mathrm e}^{i x}\right )+2 x \ln \left (1-{\mathrm e}^{i x}\right )-2 i x^{2}-2 i \polylog \left (2, -{\mathrm e}^{i x}\right )-2 i \polylog \left (2, {\mathrm e}^{i x}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int x^2\,{\cos \relax (x)}^2\,{\mathrm {cot}\relax (x)}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x^{2} \cos ^{2}{\relax (x )} \cot ^{2}{\relax (x )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________